package com.zhiyou100.entity;

/**
 * @author yang
 * @className Student
 * @packageName com.zhiyou100.entity
 * @Description TODO 学生实体类
 * @date 2020-08-16 13:07
 */
public class Student {
    private Integer id;
    private String name;
    /**
     * 多个学生可以是同一个老师，即多对一
     */
    private Teacher teacher;

    public Student(Integer id, String name, Teacher teacher) {
        this.id = id;
        this.name = name;
        this.teacher = teacher;
    }

    public Student() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Teacher getTeacher() {
        return teacher;
    }

    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", teacher=" + teacher +
                '}';
    }
}
